<script lang="ts" setup>
import { useLoginUserStore } from '@/pinia/modules';
import type { LeaveAuditors } from '@/types';

const { loginUser } = useLoginUserStore();

const leaveAuditors = defineModel<LeaveAuditors>('processInstanceAuditors', {
  required: true
});

onMounted(() => {
  leaveAuditors.value.departmentAuditor = 'yinhongqi';
  leaveAuditors.value.otherDepartmentAuditors = ['jilonghua', 'ludongqing'];
});
</script>
<template>
  <hq-form :model="leaveAuditors">
    <el-form-item label="起草节点">
      <el-input :value="loginUser.name" readonly />
    </el-form-item>
    <el-form-item label="部门审批" prop="departmentAuditor">
      <HqSelectUser v-model:username="leaveAuditors.departmentAuditor"></HqSelectUser>
    </el-form-item>
    <el-form-item label="部门会签" prop="otherDepartmentAuditors">
      <HqSelectUsers v-model:usernames="leaveAuditors.otherDepartmentAuditors"></HqSelectUsers>
    </el-form-item>
  </hq-form>
</template>
<style lang="scss" scoped></style>
